<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="layout">
<!-- layout文件路径-->
<head>
<meta charset="utf-8" />
<title>Blog后台管理中心</title>
<!-- 自定义表单样式 -->
<link rel="stylesheet" href="../../static/css/form.min.css"
	th:href="@{/css/form.min.css}" />
<style>
.col-center-block {
	float: none;
	display: block;
	margin-left: auto;
	margin-right: auto;
}
</style>
</head>

<body>
	<div layout:fragment="content"
		style="width: 90%; margin-left: auto; margin-right: auto; float: right;">
		<!-- 页面正文开始 -->
		<div class="form_main">
			<form class="form-horizontal" role="form"
				th:action="@{/admin/saveuser}" method="post" th:object="${user}">
				<fieldset>
					<legend>用户信息修改</legend>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">用户昵称</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{nickName}"
								id="ds_username" type="text" placeholder="用户001" />
						</div>
						<label class="col-sm-2 control-label" for="ds_username">用户账号</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{userName}"
								id="ds_username" type="text" placeholder="001" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">用户邮箱</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{email}" id="ds_username"
								type="text" placeholder="001@qq.com" />
						</div>
						<label class="col-sm-2 control-label" for="ds_username">用户密码</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{passWord}"
								id="ds_username" type="password" placeholder="123456" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">用户职业</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{occupation}"
								id="ds_username" type="text" placeholder="打杂" />
						</div>
						<label class="col-sm-2 control-label" for="ds_username">用户电话</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{phone}" id="ds_username"
								type="text" placeholder="13111111111" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">用户地址</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{area}" id="ds_username"
								type="text" placeholder="中国" />
						</div>
						<label class="col-sm-2 control-label" for="ds_username">用户年龄</label>
						<div class="col-sm-4">
							<input class="form-control" th:field="*{userAge}"
								id="ds_username" type="text" placeholder="18" />
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">用户头像</label>
						<div class="col-sm-4">
							<input id="lefile" type="file" style="display: none;" />
							<div class="input-append">
								<input id="photoCover" readonly="true" th:field="*{userImg}"
									class="input-large" type="text"
									style="height: 30px; border-radius: 5px; border: 1px solid #CCCCCC; padding-left: 10px;"
									placeholder="选择文件上传" /> <a class="btn"
									onclick="$('input[id=lefile]').click();"
									style="background-color: #ccc; height: 30px; color: #ffffff; width: 100px;">选择文件</a>
							</div>
							<!-- 编辑表格 -->
							<script th:inline="javascript">
								/*<![CDATA[*/
								$('input[id=lefile]').change(
										function() {
											var formData = new FormData();
											formData.append('file',
													$('#lefile')[0].files[0]);
											$.ajax({
												url : '/fileUpload',
												type : 'POST',
												cache : false,
												data : formData,
												processData : false,
												contentType : false
											}).done(
													function(res) {
														$("#photoCover").val(
																res.message);
													}).fail(function(res) {
											});
										});
								/*]]>*/
							</script>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">我的座右铭</label>
						<div class="col-sm-8">
							<textarea class="form-control ckeditor" id="TextArea1" cols="20"
								rows="2" th:field="*{userMotto}"></textarea>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-2 control-label" for="ds_username">个人简介</label>
						<div class="col-sm-8">
							<textarea class="form-control ckeditor" id="TextArea2" cols="20"
								rows="2" th:field="*{userIntroduce}"></textarea>
						</div>
					</div>
					<div class="form-group">
						<div class="col-sm-6">
							<div class="col-sm-3 col-center-block">
								<button class="btn btn-lg btn-primary btn-block" type="submit">保存</button>
							</div>
						</div>
					</div>
				</fieldset>
			</form>
		</div>
		<!-- 页面正文结束 -->
	</div>
	<!-- 编辑表格 -->
</body>
</html>